//
//  HPDropDownListView.h
//  V-POS
//
//  Created by handpay on 12-11-19.
//  Copyright (c) 2012年 handpay. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HPConditionTextField.h"

typedef enum {
    DropDownAlignmentTop = 0,
    DropDownAlignmentBottom,
    DropDownAlignmentCenter,
    DropDownAlignmentLeft,
    DropDownAlignmentRight,
}DropDownAlignment;

@class HPDropDownListView;

//@protocol HPDropDownListViewDataSource <NSObject>
//
//- (NSArray *) titlesForDropDownListView:(HPDropDownListView *)dropDownListView;
//
//@end

@protocol HPDropDownListViewDelegate <NSObject>

- (void) dropDownListView:(HPDropDownListView *)dropDownListView selected:(NSArray *)indexs texts:(NSArray *)texts;

@end

@interface HPDropDownListView : UIView<UIPickerViewDelegate, UIPickerViewDataSource>{
    UIButton* dropDownButton;
    HPConditionTextField* contentTextField;
    UIPickerView* dataPickerView;
    
    UIView* actionView;
    UIView* bgView;
    id<HPDropDownListViewDelegate> delegate;
    BOOL canInput;
}

@property(nonatomic, assign) IBOutlet id<HPDropDownListViewDelegate> delegate;

@property(nonatomic, retain) UIPickerView* dataPickerView;

@property(nonatomic, readonly) NSInteger numberOfComponents;

@property(nonatomic, assign) BOOL canInput;

- (void) reloadData;

- (void) setPlaceholder:(NSString *)holder;
- (void)setMaxLen:(uint)maxLen;
- (void)setTextFieldDelegate:(id<UITextFieldDelegate>)textFieldDelegate;

- (void)setNoDataTipStr:(NSString*)str; // 设置没有历史纪录时点击下拉框的提示语句

//读取text属性
- (NSString*)readHPtext;

//设置text属性
- (void)setHPtext:(NSString *)str;

- (void)setHPitems:(NSArray *)array;

- (void)setHPselectedindex:(NSObject *)indexs;

- (NSObject *)readHPselectedindex;

- (void)setDropDownImage:(UIImage*)imgName;

- (void)setHaveBorder:(BOOL)flag;

- (void)setShowFont:(UIFont *)font;

- (void)setShowColor:(UIColor *)color;

- (void)setBgColor:(UIColor *)color;

- (void)setTextPosition:(DropDownAlignment)alignment;

- (void)setContentTFtype:(HPConditionType)type;

- (void) setContentKebordType:(UIKeyboardType)type;
@end
